Optimal. Leaf size=241 \[ -\frac {b^3 \left (20 a^4-29 a^2 b^2+12 b^4\right ) \tan ^{-1}\left (\frac {b+a \tan \left (\frac {x}{2}\right )}{\sqrt {a^2-b^2}}\right )}{a^5 \left (a^2-b^2\right )^{5/2}}-\frac {\left (a^2+12 b^2\right ) \tanh ^{-1}(\cos (x))}{2 a^5}+\frac {3 b \left (2 a^4-7 a^2 b^2+4 b^4\right ) \cot (x)}{2 a^4 \left (a^2-b^2\right )^2}-\frac {\left (a^4-10 a^2 b^2+6 b^4\right ) \cot (x) \csc (x)}{2 a^3 \left (a^2-b^2\right )^2}-\frac {b^2 \cot (x) \csc (x)}{2 a \left (a^2-b^2\right ) (a+b \sin (x))^2}-\frac {b^2 \left (7 a^2-4 b^2\right ) \cot (x) \csc (x)}{2 a^2 \left (a^2-b^2\right )^2 (a+b \sin (x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.59, antiderivative size = 241, normalized size of antiderivative = 1.00, number of steps
used = 9, number of rules used = 7, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.538, Rules used = {2881, 3134,
3080, 3855, 2739, 632, 210} \begin {gather*} -\frac {b^2 \left (7 a^2-4 b^2\right ) \cot (x) \csc (x)}{2 a^2 \left (a^2-b^2\right )^2 (a+b \sin (x))}-\frac {b^2 \cot (x) \csc (x)}{2 a \left (a^2-b^2\right ) (a+b \sin (x))^2}-\frac {\left (a^2+12 b^2\right ) \tanh ^{-1}(\cos (x))}{2 a^5}+\frac {3 b \left (2 a^4-7 a^2 b^2+4 b^4\right ) \cot (x)}{2 a^4 \left (a^2-b^2\right )^2}-\frac {b^3 \left (20 a^4-29 a^2 b^2+12 b^4\right ) \text {ArcTan}\left (\frac {a \tan \left (\frac {x}{2}\right )+b}{\sqrt {a^2-b^2}}\right )}{a^5 \left (a^2-b^2\right )^{5/2}}-\frac {\left (a^4-10 a^2 b^2+6 b^4\right ) \cot (x) \csc (x)}{2 a^3 \left (a^2-b^2\right )^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 210
Rule 632
Rule 2739
Rule 2881
Rule 3080
Rule 3134
Rule 3855
Rubi steps
\begin {align*} \int \frac {\csc ^3(x)}{(a+b \sin (x))^3} \, dx &=-\frac {b^2 \cot (x) \csc (x)}{2 a \left (a^2-b^2\right ) (a+b \sin (x))^2}+\frac {\int \frac {\csc ^3(x) \left (2 \left (a^2-2 b^2\right )-2 a b \sin (x)+3 b^2 \sin ^2(x)\right )}{(a+b \sin (x))^2} \, dx}{2 a \left (a^2-b^2\right )}\\ &=-\frac {b^2 \cot (x) \csc (x)}{2 a \left (a^2-b^2\right ) (a+b \sin (x))^2}-\frac {b^2 \left (7 a^2-4 b^2\right ) \cot (x) \csc (x)}{2 a^2 \left (a^2-b^2\right )^2 (a+b \sin (x))}+\frac {\int \frac {\csc ^3(x) \left (2 \left (a^4-10 a^2 b^2+6 b^4\right )-a b \left (4 a^2-b^2\right ) \sin (x)+2 b^2 \left (7 a^2-4 b^2\right ) \sin ^2(x)\right )}{a+b \sin (x)} \, dx}{2 a^2 \left (a^2-b^2\right )^2}\\ &=-\frac {\left (a^4-10 a^2 b^2+6 b^4\right ) \cot (x) \csc (x)}{2 a^3 \left (a^2-b^2\right )^2}-\frac {b^2 \cot (x) \csc (x)}{2 a \left (a^2-b^2\right ) (a+b \sin (x))^2}-\frac {b^2 \left (7 a^2-4 b^2\right ) \cot (x) \csc (x)}{2 a^2 \left (a^2-b^2\right )^2 (a+b \sin (x))}+\frac {\int \frac {\csc ^2(x) \left (-6 b \left (2 a^4-7 a^2 b^2+4 b^4\right )+2 a \left (a^4+4 a^2 b^2-2 b^4\right ) \sin (x)+2 b \left (a^4-10 a^2 b^2+6 b^4\right ) \sin ^2(x)\right )}{a+b \sin (x)} \, dx}{4 a^3 \left (a^2-b^2\right )^2}\\ &=\frac {3 b \left (2 a^4-7 a^2 b^2+4 b^4\right ) \cot (x)}{2 a^4 \left (a^2-b^2\right )^2}-\frac {\left (a^4-10 a^2 b^2+6 b^4\right ) \cot (x) \csc (x)}{2 a^3 \left (a^2-b^2\right )^2}-\frac {b^2 \cot (x) \csc (x)}{2 a \left (a^2-b^2\right ) (a+b \sin (x))^2}-\frac {b^2 \left (7 a^2-4 b^2\right ) \cot (x) \csc (x)}{2 a^2 \left (a^2-b^2\right )^2 (a+b \sin (x))}+\frac {\int \frac {\csc (x) \left (2 \left (a^2-b^2\right )^2 \left (a^2+12 b^2\right )+2 a b \left (a^4-10 a^2 b^2+6 b^4\right ) \sin (x)\right )}{a+b \sin (x)} \, dx}{4 a^4 \left (a^2-b^2\right )^2}\\ &=\frac {3 b \left (2 a^4-7 a^2 b^2+4 b^4\right ) \cot (x)}{2 a^4 \left (a^2-b^2\right )^2}-\frac {\left (a^4-10 a^2 b^2+6 b^4\right ) \cot (x) \csc (x)}{2 a^3 \left (a^2-b^2\right )^2}-\frac {b^2 \cot (x) \csc (x)}{2 a \left (a^2-b^2\right ) (a+b \sin (x))^2}-\frac {b^2 \left (7 a^2-4 b^2\right ) \cot (x) \csc (x)}{2 a^2 \left (a^2-b^2\right )^2 (a+b \sin (x))}+\frac {\left (a^2+12 b^2\right ) \int \csc (x) \, dx}{2 a^5}-\frac {\left (b^3 \left (20 a^4-29 a^2 b^2+12 b^4\right )\right ) \int \frac {1}{a+b \sin (x)} \, dx}{2 a^5 \left (a^2-b^2\right )^2}\\ &=-\frac {\left (a^2+12 b^2\right ) \tanh ^{-1}(\cos (x))}{2 a^5}+\frac {3 b \left (2 a^4-7 a^2 b^2+4 b^4\right ) \cot (x)}{2 a^4 \left (a^2-b^2\right )^2}-\frac {\left (a^4-10 a^2 b^2+6 b^4\right ) \cot (x) \csc (x)}{2 a^3 \left (a^2-b^2\right )^2}-\frac {b^2 \cot (x) \csc (x)}{2 a \left (a^2-b^2\right ) (a+b \sin (x))^2}-\frac {b^2 \left (7 a^2-4 b^2\right ) \cot (x) \csc (x)}{2 a^2 \left (a^2-b^2\right )^2 (a+b \sin (x))}-\frac {\left (b^3 \left (20 a^4-29 a^2 b^2+12 b^4\right )\right ) \text {Subst}\left (\int \frac {1}{a+2 b x+a x^2} \, dx,x,\tan \left (\frac {x}{2}\right )\right )}{a^5 \left (a^2-b^2\right )^2}\\ &=-\frac {\left (a^2+12 b^2\right ) \tanh ^{-1}(\cos (x))}{2 a^5}+\frac {3 b \left (2 a^4-7 a^2 b^2+4 b^4\right ) \cot (x)}{2 a^4 \left (a^2-b^2\right )^2}-\frac {\left (a^4-10 a^2 b^2+6 b^4\right ) \cot (x) \csc (x)}{2 a^3 \left (a^2-b^2\right )^2}-\frac {b^2 \cot (x) \csc (x)}{2 a \left (a^2-b^2\right ) (a+b \sin (x))^2}-\frac {b^2 \left (7 a^2-4 b^2\right ) \cot (x) \csc (x)}{2 a^2 \left (a^2-b^2\right )^2 (a+b \sin (x))}+\frac {\left (2 b^3 \left (20 a^4-29 a^2 b^2+12 b^4\right )\right ) \text {Subst}\left (\int \frac {1}{-4 \left (a^2-b^2\right )-x^2} \, dx,x,2 b+2 a \tan \left (\frac {x}{2}\right )\right )}{a^5 \left (a^2-b^2\right )^2}\\ &=-\frac {b^3 \left (20 a^4-29 a^2 b^2+12 b^4\right ) \tan ^{-1}\left (\frac {b+a \tan \left (\frac {x}{2}\right )}{\sqrt {a^2-b^2}}\right )}{a^5 \left (a^2-b^2\right )^{5/2}}-\frac {\left (a^2+12 b^2\right ) \tanh ^{-1}(\cos (x))}{2 a^5}+\frac {3 b \left (2 a^4-7 a^2 b^2+4 b^4\right ) \cot (x)}{2 a^4 \left (a^2-b^2\right )^2}-\frac {\left (a^4-10 a^2 b^2+6 b^4\right ) \cot (x) \csc (x)}{2 a^3 \left (a^2-b^2\right )^2}-\frac {b^2 \cot (x) \csc (x)}{2 a \left (a^2-b^2\right ) (a+b \sin (x))^2}-\frac {b^2 \left (7 a^2-4 b^2\right ) \cot (x) \csc (x)}{2 a^2 \left (a^2-b^2\right )^2 (a+b \sin (x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 1.26, size = 220, normalized size = 0.91 \begin {gather*} \frac {-\frac {8 b^3 \left (20 a^4-29 a^2 b^2+12 b^4\right ) \tan ^{-1}\left (\frac {b+a \tan \left (\frac {x}{2}\right )}{\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right )^{5/2}}+12 a b \cot \left (\frac {x}{2}\right )-a^2 \csc ^2\left (\frac {x}{2}\right )-4 \left (a^2+12 b^2\right ) \log \left (\cos \left (\frac {x}{2}\right )\right )+4 \left (a^2+12 b^2\right ) \log \left (\sin \left (\frac {x}{2}\right )\right )+a^2 \sec ^2\left (\frac {x}{2}\right )-\frac {4 a^2 b^4 \cos (x)}{(a-b) (a+b) (a+b \sin (x))^2}+\frac {12 a b^4 \left (-3 a^2+2 b^2\right ) \cos (x)}{(a-b)^2 (a+b)^2 (a+b \sin (x))}-12 a b \tan \left (\frac {x}{2}\right )}{8 a^5} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.54, size = 329, normalized size = 1.37
method | result | size |
default | \(\frac {\frac {a \left (\tan ^{2}\left (\frac {x}{2}\right )\right )}{2}-6 b \tan \left (\frac {x}{2}\right )}{4 a^{4}}-\frac {1}{8 a^{3} \tan \left (\frac {x}{2}\right )^{2}}+\frac {\left (2 a^{2}+24 b^{2}\right ) \ln \left (\tan \left (\frac {x}{2}\right )\right )}{4 a^{5}}+\frac {3 b}{2 a^{4} \tan \left (\frac {x}{2}\right )}-\frac {4 b^{3} \left (\frac {\frac {a \,b^{2} \left (11 a^{2}-8 b^{2}\right ) \left (\tan ^{3}\left (\frac {x}{2}\right )\right )}{4 a^{4}-8 a^{2} b^{2}+4 b^{4}}+\frac {b \left (10 a^{4}+13 a^{2} b^{2}-14 b^{4}\right ) \left (\tan ^{2}\left (\frac {x}{2}\right )\right )}{4 a^{4}-8 a^{2} b^{2}+4 b^{4}}+\frac {a \,b^{2} \left (29 a^{2}-20 b^{2}\right ) \tan \left (\frac {x}{2}\right )}{4 a^{4}-8 a^{2} b^{2}+4 b^{4}}+\frac {a^{2} b \left (10 a^{2}-7 b^{2}\right )}{4 a^{4}-8 a^{2} b^{2}+4 b^{4}}}{\left (a \left (\tan ^{2}\left (\frac {x}{2}\right )\right )+2 b \tan \left (\frac {x}{2}\right )+a \right )^{2}}+\frac {\left (20 a^{4}-29 a^{2} b^{2}+12 b^{4}\right ) \arctan \left (\frac {2 a \tan \left (\frac {x}{2}\right )+2 b}{2 \sqrt {a^{2}-b^{2}}}\right )}{4 \left (a^{4}-2 a^{2} b^{2}+b^{4}\right ) \sqrt {a^{2}-b^{2}}}\right )}{a^{5}}\) | \(329\) |
risch | \(\frac {5 i a^{2} b^{5} {\mathrm e}^{6 i x}+24 i a^{6} b \,{\mathrm e}^{4 i x}+40 i a^{4} b^{3} {\mathrm e}^{2 i x}+12 i b^{7}+4 a^{7} {\mathrm e}^{5 i x}+4 a^{7} {\mathrm e}^{3 i x}-4 i a^{6} b \,{\mathrm e}^{6 i x}+20 i a^{4} b^{3} {\mathrm e}^{6 i x}-20 i a^{6} b \,{\mathrm e}^{2 i x}-66 i a^{4} b^{3} {\mathrm e}^{4 i x}-15 i a^{2} b^{5} {\mathrm e}^{4 i x}+31 i b^{5} a^{2} {\mathrm e}^{2 i x}-90 a^{3} b^{4} {\mathrm e}^{5 i x}+54 a \,b^{6} {\mathrm e}^{5 i x}+6 i a^{4} b^{3}-21 i a^{2} b^{5}-74 a^{3} b^{4} {\mathrm e}^{i x}+42 a \,b^{6} {\mathrm e}^{i x}+23 a^{5} b^{2} {\mathrm e}^{i x}-36 i b^{7} {\mathrm e}^{2 i x}-a^{5} b^{2} {\mathrm e}^{7 i x}+10 a^{3} b^{4} {\mathrm e}^{7 i x}-6 a \,b^{6} {\mathrm e}^{7 i x}+17 a^{5} b^{2} {\mathrm e}^{5 i x}+36 i b^{7} {\mathrm e}^{4 i x}-12 i b^{7} {\mathrm e}^{6 i x}-55 a^{5} b^{2} {\mathrm e}^{3 i x}+162 a^{3} b^{4} {\mathrm e}^{3 i x}-90 a \,b^{6} {\mathrm e}^{3 i x}}{\left ({\mathrm e}^{2 i x}-1\right )^{2} \left (-i b \,{\mathrm e}^{2 i x}+i b +2 a \,{\mathrm e}^{i x}\right )^{2} \left (a^{2}-b^{2}\right )^{2} a^{4}}+\frac {\ln \left ({\mathrm e}^{i x}-1\right )}{2 a^{3}}+\frac {6 \ln \left ({\mathrm e}^{i x}-1\right ) b^{2}}{a^{5}}-\frac {\ln \left ({\mathrm e}^{i x}+1\right )}{2 a^{3}}-\frac {6 \ln \left ({\mathrm e}^{i x}+1\right ) b^{2}}{a^{5}}-\frac {10 i b^{3} \ln \left ({\mathrm e}^{i x}+\frac {i \left (\sqrt {a^{2}-b^{2}}\, a +a^{2}-b^{2}\right )}{\sqrt {a^{2}-b^{2}}\, b}\right )}{\sqrt {a^{2}-b^{2}}\, \left (a +b \right )^{2} \left (a -b \right )^{2} a}+\frac {29 i b^{5} \ln \left ({\mathrm e}^{i x}+\frac {i \left (\sqrt {a^{2}-b^{2}}\, a +a^{2}-b^{2}\right )}{\sqrt {a^{2}-b^{2}}\, b}\right )}{2 \sqrt {a^{2}-b^{2}}\, \left (a +b \right )^{2} \left (a -b \right )^{2} a^{3}}-\frac {6 i b^{7} \ln \left ({\mathrm e}^{i x}+\frac {i \left (\sqrt {a^{2}-b^{2}}\, a +a^{2}-b^{2}\right )}{\sqrt {a^{2}-b^{2}}\, b}\right )}{\sqrt {a^{2}-b^{2}}\, \left (a +b \right )^{2} \left (a -b \right )^{2} a^{5}}+\frac {10 i b^{3} \ln \left ({\mathrm e}^{i x}+\frac {i \left (\sqrt {a^{2}-b^{2}}\, a -a^{2}+b^{2}\right )}{\sqrt {a^{2}-b^{2}}\, b}\right )}{\sqrt {a^{2}-b^{2}}\, \left (a +b \right )^{2} \left (a -b \right )^{2} a}-\frac {29 i b^{5} \ln \left ({\mathrm e}^{i x}+\frac {i \left (\sqrt {a^{2}-b^{2}}\, a -a^{2}+b^{2}\right )}{\sqrt {a^{2}-b^{2}}\, b}\right )}{2 \sqrt {a^{2}-b^{2}}\, \left (a +b \right )^{2} \left (a -b \right )^{2} a^{3}}+\frac {6 i b^{7} \ln \left ({\mathrm e}^{i x}+\frac {i \left (\sqrt {a^{2}-b^{2}}\, a -a^{2}+b^{2}\right )}{\sqrt {a^{2}-b^{2}}\, b}\right )}{\sqrt {a^{2}-b^{2}}\, \left (a +b \right )^{2} \left (a -b \right )^{2} a^{5}}\) | \(922\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 971 vs.
\(2 (225) = 450\).
time = 1.46, size = 2005, normalized size = 8.32 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\csc ^{3}{\left (x \right )}}{\left (a + b \sin {\left (x \right )}\right )^{3}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 514 vs.
\(2 (225) = 450\).
time = 0.49, size = 514, normalized size = 2.13 \begin {gather*} -\frac {{\left (20 \, a^{4} b^{3} - 29 \, a^{2} b^{5} + 12 \, b^{7}\right )} {\left (\pi \left \lfloor \frac {x}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (a\right ) + \arctan \left (\frac {a \tan \left (\frac {1}{2} \, x\right ) + b}{\sqrt {a^{2} - b^{2}}}\right )\right )}}{{\left (a^{9} - 2 \, a^{7} b^{2} + a^{5} b^{4}\right )} \sqrt {a^{2} - b^{2}}} - \frac {2 \, a^{8} \tan \left (\frac {1}{2} \, x\right )^{6} + 20 \, a^{6} b^{2} \tan \left (\frac {1}{2} \, x\right )^{6} - 46 \, a^{4} b^{4} \tan \left (\frac {1}{2} \, x\right )^{6} + 24 \, a^{2} b^{6} \tan \left (\frac {1}{2} \, x\right )^{6} - 4 \, a^{7} b \tan \left (\frac {1}{2} \, x\right )^{5} + 104 \, a^{5} b^{3} \tan \left (\frac {1}{2} \, x\right )^{5} - 108 \, a^{3} b^{5} \tan \left (\frac {1}{2} \, x\right )^{5} + 32 \, a b^{7} \tan \left (\frac {1}{2} \, x\right )^{5} + 5 \, a^{8} \tan \left (\frac {1}{2} \, x\right )^{4} - 2 \, a^{6} b^{2} \tan \left (\frac {1}{2} \, x\right )^{4} + 165 \, a^{4} b^{4} \tan \left (\frac {1}{2} \, x\right )^{4} - 80 \, a^{2} b^{6} \tan \left (\frac {1}{2} \, x\right )^{4} - 16 \, b^{8} \tan \left (\frac {1}{2} \, x\right )^{4} - 12 \, a^{7} b \tan \left (\frac {1}{2} \, x\right )^{3} + 72 \, a^{5} b^{3} \tan \left (\frac {1}{2} \, x\right )^{3} + 124 \, a^{3} b^{5} \tan \left (\frac {1}{2} \, x\right )^{3} - 112 \, a b^{7} \tan \left (\frac {1}{2} \, x\right )^{3} + 4 \, a^{8} \tan \left (\frac {1}{2} \, x\right )^{2} - 28 \, a^{6} b^{2} \tan \left (\frac {1}{2} \, x\right )^{2} + 124 \, a^{4} b^{4} \tan \left (\frac {1}{2} \, x\right )^{2} - 76 \, a^{2} b^{6} \tan \left (\frac {1}{2} \, x\right )^{2} - 8 \, a^{7} b \tan \left (\frac {1}{2} \, x\right ) + 16 \, a^{5} b^{3} \tan \left (\frac {1}{2} \, x\right ) - 8 \, a^{3} b^{5} \tan \left (\frac {1}{2} \, x\right ) + a^{8} - 2 \, a^{6} b^{2} + a^{4} b^{4}}{8 \, {\left (a^{9} - 2 \, a^{7} b^{2} + a^{5} b^{4}\right )} {\left (a \tan \left (\frac {1}{2} \, x\right )^{3} + 2 \, b \tan \left (\frac {1}{2} \, x\right )^{2} + a \tan \left (\frac {1}{2} \, x\right )\right )}^{2}} + \frac {{\left (a^{2} + 12 \, b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, x\right ) \right |}\right )}{2 \, a^{5}} + \frac {a^{3} \tan \left (\frac {1}{2} \, x\right )^{2} - 12 \, a^{2} b \tan \left (\frac {1}{2} \, x\right )}{8 \, a^{6}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 9.28, size = 2405, normalized size = 9.98 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________